import request from '@/utils/request'
import formurlencoded from 'form-urlencoded'

//优惠券列表
export function listCoupon(query) {
  return request({
    url: '/admin/promotion/coupon/list',
    method: 'get',
    params: query
  })
}

//优惠券审核页面取数据
export function auditCoupon(query) {
  return request({
    url: '/admin/promotion/coupon/audit',
    method: 'get',
    params: query
  })
}

//优惠券审核
export function doauditCoupon(data) {
  return request({
    url: '/admin/promotion/coupon/doaudit',
    method: 'post',
    data: formurlencoded(data)
  })
}

//优惠券发放列表
export function listCouponUser(query) {
  return request({
    url: '/admin/promotion/couponuser/list',
    method: 'get',
    params: query
  })
}

//单品立减管理列表
export function listActSingle(query) {
  return request({
    url: '/admin/promotion/single/list',
    method: 'get',
    params: query
  })
}

//单品立减详情页
export function detailActSingle(query) {
  return request({
    url: '/admin/promotion/single/detail',
    method: 'get',
    params: query
  })
}

//单品立减页面取数据
export function auditActSingle(query) {
  return request({
    url: '/admin/promotion/single/audit',
    method: 'get',
    params: query
  })
}

//单品立减审核
export function doauditActSingle(data) {
  return request({
    url: '/admin/promotion/single/doaudit',
    method: 'post',
    data: formurlencoded(data)
  })
}

//订单满减活动列表
export function listActFull(query) {
  return request({
    url: '/admin/promotion/full/list',
    method: 'get',
    params: query
  })
}

//订单满减页面取数据
export function auditActFull(query) {
  return request({
    url: '/admin/promotion/full/audit',
    method: 'get',
    params: query
  })
}

//订单满减审核
export function doauditActFull(data) {
  return request({
    url: '/admin/promotion/full/doaudit',
    method: 'post',
    data: formurlencoded(data)
  })
}
